// 获取地址栏的值
export function getUrlParam(url) {
    let regx = /([^&?=]+)=([^&?=]+)/g;
    let obj = {};
    url.replace(regx, (...args) => {
        if (obj[args[1]]) {
            obj[args[1]] = Array.isArray(obj[args[1]]) ?
                obj[args[1]] : [obj[args[1]]];
            obj[args[1]].push(args[2]);
        } else {
            obj[args[1]] = args[2];
        }
    });
    return obj;
}

//用于生成uuid
function S4() {
    return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
}
export function guid() {
    return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4());
}